<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="org.springframework.web.context.support.WebApplicationContextUtils" %>
<%@ page import="org.springframework.context.ApplicationContext" %>
<%@page import="java.net.URLDecoder"%>
<%@ page import="com.sz.courseserial.dao.ICourseSerialDAO" %>
<%@ page import="com.sz.common.SZUtility" %>

<%
//如有更给，要考虑viewTicket.jsp 是否要改

String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";


String style1 = "width: 100px;text-align:right;font-size: 12px;";
String style2 = "font-size: 12px";

String input_text = "width: 220px";
String input_text_gray = "width: 220px; color: gray";






ServletContext servletContext = request.getSession().getServletContext(); 
ApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(servletContext);
ICourseSerialDAO courseserial = (ICourseSerialDAO) context.getBean("CourseSerialDAO");

String show_title = request.getParameter("show_title");
if(show_title == null || show_title.length() == 0) show_title = "1"; //默认显示

String show_confirm_title = request.getParameter("show_confirm_title"); //是否显示"确认信息"四个字
if(show_confirm_title == null || show_confirm_title.length() == 0) show_confirm_title = "1"; //默认显示

Map<Object, Object> param = new HashMap<Object, Object>();
String serial_id = request.getParameter("serial_id");
param.put("SERIAL_ID", serial_id);
List list = courseserial.queryCourseSerial(param);
Map map = new HashMap();
if(list.size() > 0) {
	map = (Map)list.get(0);
}
String name = SZUtility.toString(map.get("NAME"));
String desc = SZUtility.toString(map.get("DESCRIP"));
%>



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<link href="<%= request.getContextPath() %>/css/main.css" rel="stylesheet" type="text/css" />
		<base href="<%=basePath%>" target="_self"></br>
		<title>一级菜系修改</title>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="">
		<meta http-equiv="description" content="一级菜系修改" >
	</head>
	
	<body>
		<script type="text/javascript" src="js/calendar.js"></script>
		<script type="text/javascript" src="js/utility.js"></script>

		<table width="100%">
		  <tr>
		  	<td colspan="3" class="title0" >一级菜系修改</td>		  	
	  	  </tr>
	  	</table> 
		</br>
	  	<table id = "business_info" width="100%" border="0" cellpadding="0" cellspacing="0" style="line-height:30px;">
	  		<tr>
	  			<td style="<%=style1%>">名称&nbsp</td>
	  			<td>
	  				<input type="text" id="name" name="name" value="<%=name%>" style="<%=input_text_gray%>" >
	  			</td>
	  		</tr>
	  		<tr>	
	  			<td style="<%=style1%>">描述&nbsp</td>
	  			<td>
	  				<input type="text" id="desc" name="desc" value="<%=desc%>" style="<%=input_text_gray%>" >
	  			</td>
	  		</tr>
	  	</table>
	   	<table width="100%">
  			<tr><td align="center">
	  		<input type="button" value="确定" onclick="onSubmit()">
			</td></tr>
	  	</table>

  	<form id="submitForm" method="post" action="courseserial/editCourseSerial.exec" style="display: none;">
  		<input id="OPERATE_TYPE" name="OPERATE_TYPE" value="" />
  		<input id="PARAM" name="PARAM" value="" />
  	</form>
  	
  	<SCRIPT LANGUAGE="JavaScript">
	  		function onSubmit() {
	  		
	  			var param = "{SERIAL_ID:";
  				param += "'"+"<%=serial_id%>"+"',";
  				param += "NAME:'";
  				param += document.getElementById("name").value + "',";
  				param += "DESCRIP:'";
  				param += document.getElementById("desc").value + "'";
  				param += "}";

  				document.getElementById("OPERATE_TYPE").value = "EDIT";
  				document.getElementById("PARAM").value = param;
  				document.getElementById("submitForm").submit();

  		  		window.close();	
  	  		} 
  		
  	</SCRIPT>
	</body>
</html>
